package com.orange.score.activity.more;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.text.Editable;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.orange.score.activity.common.CommonFootballActivity;
import com.orange.score.model.user.UserManager;
import com.orange.score.service.UserService;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class FeedbackActivity extends CommonFootballActivity
{
  private static final String TAG = "FeedbackActivity";
  private static String URL = "http://bf.bet007.com/phone/Feedback.aspx?UserID=%s&content=%s&contact=%s";
  private EditText commentText;
  private EditText contactText;
  private Button submitButton;
  private TextView textView;
  private UserManager userManager;
  private UserService userService = new UserService();

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    requestWindowFeature(1);
    setContentView(2130903074);
    this.commentText = ((EditText)findViewById(2131558473));
    this.contactText = ((EditText)findViewById(2131558474));
    this.submitButton = ((Button)findViewById(2131558475));
    this.textView = ((TextView)findViewById(2131558477));
    try
    {
      String str = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
      this.textView.setText("版本号：".concat(str));
      this.submitButton.setOnClickListener(new View.OnClickListener(this)
      {
        public void onClick()
        {
          String str1 = FeedbackActivity.access$0(this.this$0).getText().toString().trim();
          String str2 = FeedbackActivity.access$1(this.this$0).getText().toString().trim();
          if (str1.equals(""))
          {
            AlertDialog.Builder localBuilder = new AlertDialog.Builder(this.this$0);
            localBuilder.setTitle("请输入评价内容");
            localBuilder.setPositiveButton(2131361815, new DialogInterface.OnClickListener(this)
            {
              public void onClick(, int paramInt)
              {
              }
            });
            localBuilder.create().show();
            return;
          }
          try
          {
            String str3 = URLEncoder.encode(str1, "GB2312");
            String str4 = URLEncoder.encode(str2, "GB2312");
            FeedbackActivity.access$2(this.this$0, UserManager.getInstance());
            String str5 = FeedbackActivity.access$3(this.this$0).getUserId();
            String str6 = FeedbackActivity.access$4();
            Object[] arrayOfObject = new Object[3];
            arrayOfObject[0] = str5;
            arrayOfObject[1] = str3;
            arrayOfObject[2] = str4;
            String str7 = String.format(str6, arrayOfObject);
            Log.i("FeedbackActivity", "Comment=" + str7);
            FeedbackActivity.access$5(this.this$0).CommitComment(this.this$0, str7);
          }
          catch (UnsupportedEncodingException localUnsupportedEncodingException)
          {
            Log.e("FeedbackActivity", localUnsupportedEncodingException.toString());
          }
        }
      });
      return;
    }
    catch (PackageManager.NameNotFoundException localNameNotFoundException)
    {
      Log.i("FeedbackActivity", localNameNotFoundException.toString());
    }
  }
}